package com.example.demo.activemq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dinghx
 */
@RestController
public class MyBean{

    @Autowired
    private JmsTemplate jmsTemplate;

    @RequestMapping("/send")
    public void send(String text) {
        jmsTemplate.convertAndSend("itcast", text);
    }
}
